class picture
{
public:
char name[256];
int sx,sy,bytespixel,size;
unsigned char **buf;
picture();
int LoadTGA(char *file);
int SaveTGA(char *file);
int LoadPIC(char *file);
int LoadJPG(char *file);
int CreatePicture32(int xd,int yd);
int CreatePicture24(int xd,int yd);
void FreePicture(void);
void ErasePicture(char c);
virtual ~picture();
};
Member | Type | Description |
---|---|---|
name | char [] | picture filename |
sx | int | x size in pixels |
sy | int | y size in pixels |
bytespixel | int | number of bytes per pixel (24 or 32) |
size | int | size in bytes for the image (sx*sy*bytespixel) |
buf | unsigned char ** | image pixels |
LoadTGA, SaveTGA, LoadPIC, LoadJPG, CreatePicture32, CreatePicture24, FreePicture
This class implements a picture with 24 or 32 bits/pixel. The picture pixels are allocated in a single array of bytes (buf[0]) and the other variables are just shortcuts to the picture lines (buf[1] to buf[sy-1]).
picture p;
p.LoadJPG("mypic.jpg");
p.SaveTGA("mypic.tga");